package com.jtpay.sth0409.patternlockdemo;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.jtpay.sth0409.patternlockdemo.Util.AppUtil;
import com.jtpay.sth0409.patternlockdemo.Util.SPUtils;

/**
 * 忘记密码页面
 */
public class ResetActivity extends Activity implements View.OnClickListener {

    private Button cancel_button;
    private Button ok_button;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_reset);
        initView();
    }

    private void initView() {
        cancel_button = (Button) findViewById(R.id.cancel_button);
        ok_button = (Button) findViewById(R.id.ok_button);

        cancel_button.setOnClickListener(this);
        ok_button.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.cancel_button:
                this.finish();
                break;
            case R.id.ok_button:
                SPUtils.getInstance(this).clearPattern();
                this.finish();
                AppUtil.getInstance(this).finishAllAC();
                break;
        }
    }
}
